Optimal. Leaf size=180 \[ \frac {b \left (6 a^2 C+20 a b B+9 b^2 C\right ) \tan (c+d x) \sec (c+d x)}{24 d}+\frac {\left (3 a^3 C+16 a^2 b B+12 a b^2 C+4 b^3 B\right ) \tan (c+d x)}{6 d}+\frac {\left (8 a^3 B+12 a^2 b C+12 a b^2 B+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {(3 a C+4 b B) \tan (c+d x) (a+b \sec (c+d x))^2}{12 d}+\frac {C \tan (c+d x) (a+b \sec (c+d x))^3}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.26, antiderivative size = 180, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {4056, 4048, 3770, 3767, 8} \[ \frac {\left (16 a^2 b B+3 a^3 C+12 a b^2 C+4 b^3 B\right ) \tan (c+d x)}{6 d}+\frac {\left (12 a^2 b C+8 a^3 B+12 a b^2 B+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b \left (6 a^2 C+20 a b B+9 b^2 C\right ) \tan (c+d x) \sec (c+d x)}{24 d}+\frac {(3 a C+4 b B) \tan (c+d x) (a+b \sec (c+d x))^2}{12 d}+\frac {C \tan (c+d x) (a+b \sec (c+d x))^3}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3770
Rule 4048
Rule 4056
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{4} \int (a+b \sec (c+d x))^2 \left ((4 a B+3 b C) \sec (c+d x)+(4 b B+3 a C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{12} \int (a+b \sec (c+d x)) \left (\left (12 a^2 B+8 b^2 B+15 a b C\right ) \sec (c+d x)+\left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b \left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{24} \int \left (3 \left (8 a^3 B+12 a b^2 B+12 a^2 b C+3 b^3 C\right ) \sec (c+d x)+4 \left (16 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b \left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{6} \left (16 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{8} \left (8 a^3 B+12 a b^2 B+12 a^2 b C+3 b^3 C\right ) \int \sec (c+d x) \, dx\\ &=\frac {\left (8 a^3 B+12 a b^2 B+12 a^2 b C+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b \left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {\left (16 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{6 d}\\ &=\frac {\left (8 a^3 B+12 a b^2 B+12 a^2 b C+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (16 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \tan (c+d x)}{6 d}+\frac {b \left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac {(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.90, size = 140, normalized size = 0.78 \[ \frac {3 \left (8 a^3 B+12 a^2 b C+12 a b^2 B+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (9 b \left (4 a^2 C+4 a b B+b^2 C\right ) \sec (c+d x)+24 \left (a^3 C+3 a^2 b B+3 a b^2 C+b^3 B\right )+8 b^2 (3 a C+b B) \tan ^2(c+d x)+6 b^3 C \sec ^3(c+d x)\right )}{24 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.84, size = 211, normalized size = 1.17 \[ \frac {3 \, {\left (8 \, B a^{3} + 12 \, C a^{2} b + 12 \, B a b^{2} + 3 \, C b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (8 \, B a^{3} + 12 \, C a^{2} b + 12 \, B a b^{2} + 3 \, C b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (6 \, C b^{3} + 8 \, {\left (3 \, C a^{3} + 9 \, B a^{2} b + 6 \, C a b^{2} + 2 \, B b^{3}\right )} \cos \left (d x + c\right )^{3} + 9 \, {\left (4 \, C a^{2} b + 4 \, B a b^{2} + C b^{3}\right )} \cos \left (d x + c\right )^{2} + 8 \, {\left (3 \, C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.31, size = 586, normalized size = 3.26 \[ \frac {3 \, {\left (8 \, B a^{3} + 12 \, C a^{2} b + 12 \, B a b^{2} + 3 \, C b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (8 \, B a^{3} + 12 \, C a^{2} b + 12 \, B a b^{2} + 3 \, C b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (24 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 72 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 36 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 36 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 72 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 72 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 216 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 36 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 36 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 120 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 72 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 216 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 36 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 36 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 120 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 40 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 72 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 36 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 36 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 72 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.62, size = 290, normalized size = 1.61 \[ \frac {a^{3} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a^{3} C \tan \left (d x +c \right )}{d}+\frac {3 a^{2} b B \tan \left (d x +c \right )}{d}+\frac {3 C \,a^{2} b \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {3 C \,a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {3 B a \,b^{2} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {3 B a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 C a \,b^{2} \tan \left (d x +c \right )}{d}+\frac {C a \,b^{2} \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{d}+\frac {2 b^{3} B \tan \left (d x +c \right )}{3 d}+\frac {b^{3} B \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d}+\frac {b^{3} C \tan \left (d x +c \right ) \left (\sec ^{3}\left (d x +c \right )\right )}{4 d}+\frac {3 b^{3} C \sec \left (d x +c \right ) \tan \left (d x +c \right )}{8 d}+\frac {3 b^{3} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.34, size = 266, normalized size = 1.48 \[ \frac {48 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a b^{2} + 16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B b^{3} - 3 \, C b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 36 \, C a^{2} b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 36 \, B a b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, B a^{3} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 48 \, C a^{3} \tan \left (d x + c\right ) + 144 \, B a^{2} b \tan \left (d x + c\right )}{48 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.78, size = 395, normalized size = 2.19 \[ \frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B\,a^3+\frac {3\,C\,a^2\,b}{2}+\frac {3\,B\,a\,b^2}{2}+\frac {3\,C\,b^3}{8}\right )}{4\,B\,a^3+6\,C\,a^2\,b+6\,B\,a\,b^2+\frac {3\,C\,b^3}{2}}\right )\,\left (2\,B\,a^3+3\,C\,a^2\,b+3\,B\,a\,b^2+\frac {3\,C\,b^3}{4}\right )}{d}-\frac {\left (2\,B\,b^3+2\,C\,a^3-\frac {5\,C\,b^3}{4}-3\,B\,a\,b^2+6\,B\,a^2\,b+6\,C\,a\,b^2-3\,C\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (3\,B\,a\,b^2-6\,C\,a^3-\frac {3\,C\,b^3}{4}-\frac {10\,B\,b^3}{3}-18\,B\,a^2\,b-10\,C\,a\,b^2+3\,C\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {10\,B\,b^3}{3}+6\,C\,a^3-\frac {3\,C\,b^3}{4}+3\,B\,a\,b^2+18\,B\,a^2\,b+10\,C\,a\,b^2+3\,C\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (-2\,B\,b^3-2\,C\,a^3-\frac {5\,C\,b^3}{4}-3\,B\,a\,b^2-6\,B\,a^2\,b-6\,C\,a\,b^2-3\,C\,a^2\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (B + C \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{3} \sec {\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________